<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    {{msg}} {{student.name}}
    <hr>
    <input type="text" v-model="student.name">
    <input type="button" value="修改名称" @click="editStudent">
</div>
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<script>
    //mv    vm
    var app = new Vue({
        el: '#app',
        data: function () {
            return {
                msg:"hello word",
                student:{
                   id:1,
                   name:"张三",
                   hobby:["篮球","游泳","郊游"]
                }
            }
        },
        methods:{
            editStudent: function () {
                this.student.name="李四";
            }
        },
        //生命周期里一个方法
        created: function () {
            console.log("created")
        }
    })
</script>
</body>
</html>
